package Java测试.编码1copy;

import java.util.TreeSet;

public class test {
    public static void main(String[] args) {
        Worker worker1 = new Worker("李四", 34, 3000);
        Worker worker2 = new Worker("王五", 53, 5200);
        Worker worker3 = new Worker("张三", 34, 5200);
        Worker worker4 = new Worker("赵六", 23, 8000);
        Worker worker5 = new Worker("大傻", 52, 6500);
        TreeSet<Worker> workers = new TreeSet<>();
        workers.add(worker1);
        workers.add(worker2);
        workers.add(worker3);
        workers.add(worker4);
        workers.add(worker5);
        for (Worker worker : workers) {
            System.out.println(worker.getName()+":"+worker.getAge());
        }
    }
}
